package cn.com.utt.unms.vo;

import java.sql.Timestamp;
import java.text.SimpleDateFormat;

import cn.com.utt.unms.pojo.Device;

public class DeviceInfo {

	// 设备类型 已有 type
	// 设备名称/MAC地址 已有 name
	// IP地址 已有 ip
	// 状态 已有 status
	// 设备型号 已有 model
	// 软件版本 已有 softVer
	// 所属分组 已有 group
	// 客户端数量 已有 clients
	// 2.4G SSID 已有 ssid24G
	// 5G SSID 已有 ssid5G
	// 2.4G客户端 已有 client24G
	// 5G客户端 已有 client5G
	// 上传流量 已有 sent
	// 下载流量 已有 recv
	// 模式/信道
	// 序列号 已有 sn
	// 硬件版本 已有 hardwareVer
	// 在线时长 已有 uptime
	// 射频配置 已有 rfConfig
	// 无线配置 暂无 wireless
	// 上行速率 已有 txrate
	// 下行速率 已有 rxrate
	// CPU使用率 已有 cpuUsedpercent
	// 内存使用率 已有 memUsedpercent
	// 绑定时间 已有 bindTime
	// 系统模式 已有 systemMode

	private long id;
	private String group;
	private String model;
	private Long modelId;
	private String name;
	private String sn;
	private String mac;
	private String type;
	private String hardwareVer;
	private String softVer;
	private String systemMode;
	private String rfConfig;
	private String wireless;
	private String ssid24G;
	private String ssid5G;
	private Timestamp bindTime;
	private String ip;
	private String uptime;
	private int clients;
	private int client24G;
	private int client5G;
	private int aps;
	private String rxrate;
	private String txrate;
	private String recv;
	private String sent;
	private String cpuUsedpercent;
	private String memUsedpercent;
	private long networkId;
	private Long rfConfigId;
	private byte radio;
	private byte status;
	private Byte isFast;
	private Byte isWirelessExtend;

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getGroup() {
		return group;
	}

	public void setGroup(String group) {
		this.group = group;
	}

	public String getModel() {
		return model;
	}

	public void setModel(String model) {
		this.model = model;
	}

	public Long getModelId() {
		return modelId;
	}

	public void setModelId(Long modelId) {
		this.modelId = modelId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getSn() {
		return sn;
	}

	public void setSn(String sn) {
		this.sn = sn;
	}

	public String getMac() {
		return mac;
	}

	public void setMac(String mac) {
		this.mac = mac;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getHardwareVer() {
		return hardwareVer;
	}

	public void setHardwareVer(String hardwareVer) {
		this.hardwareVer = hardwareVer;
	}

	public String getSoftVer() {
		return softVer;
	}

	public void setSoftVer(String softVer) {
		this.softVer = softVer;
	}

	public String getSystemMode() {
		return systemMode;
	}

	public void setSystemMode(String systemMode) {
		this.systemMode = systemMode;
	}

	public String getRfConfig() {
		return rfConfig;
	}

	public void setRfConfig(String rfConfig) {
		this.rfConfig = rfConfig;
	}

	public String getBindTime() {
		SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		return formatter.format(bindTime);
	}

	public void setBindTime(Timestamp bindTime) {
		this.bindTime = bindTime;
	}

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public String getUptime() {
		return uptime;
	}

	public void setUptime(String uptime) {
		this.uptime = uptime;
	}

	public int getClients() {
		return clients;
	}

	public void setClients(int clients) {
		this.clients = clients;
	}

	public Long getRfConfigId() {
		return rfConfigId;
	}

	public void setRfConfigId(Long rfConfigId) {
		this.rfConfigId = rfConfigId;
	}

	public byte getRadio() {
		return radio;
	}

	public void setRadio(byte radio) {
		this.radio = radio;
	}

	public int getClient24G() {
		return client24G;
	}

	public int getClient5G() {
		return client5G;
	}

	public void setClient24G(int client24g) {
		client24G = client24g;
	}

	public void setClient5G(int client5g) {
		client5G = client5g;
	}

	public String getRxrate() {
		return rxrate;
	}

	public String getTxrate() {
		return txrate;
	}

	public void setRxrate(String rxrate) {
		this.rxrate = rxrate;
	}

	public void setTxrate(String txrate) {
		this.txrate = txrate;
	}

	public String getRecv() {
		return recv;
	}

	public String getSent() {
		return sent;
	}

	public void setRecv(String recv) {
		this.recv = recv;
	}

	public void setSent(String sent) {
		this.sent = sent;
	}

	public String getCpuUsedpercent() {
		return cpuUsedpercent;
	}

	public void setCpuUsedpercent(String cpuUsedpercent) {
		this.cpuUsedpercent = cpuUsedpercent;
	}

	public String getMemUsedpercent() {
		return memUsedpercent;
	}

	public void setMemUsedpercent(String memUsedpercent) {
		this.memUsedpercent = memUsedpercent;
	}

	public String getWireless() {
		return wireless;
	}

	public void setWireless(String wireless) {
		this.wireless = wireless;
	}

	public String getSsid24G() {
		return ssid24G;
	}

	public String getSsid5G() {
		return ssid5G;
	}

	public void setSsid24G(String ssid24g) {
		ssid24G = ssid24g;
	}

	public void setSsid5G(String ssid5g) {
		ssid5G = ssid5g;
	}

	public long getNetworkId() {
		return networkId;
	}

	public void setNetworkId(long networkId) {
		this.networkId = networkId;
	}

	public byte getStatus() {
		return status;
	}

	public void setStatus(byte status) {
		this.status = status;
	}
	
	public Byte getIsFast() {
		return isFast;
	}
	
	public void setIsFast(Byte isFast) {
		this.isFast = isFast;
	}

	public int getAps() {
		return aps;
	}

	public void setAps(int aps) {
		this.aps = aps;
	}

	public Byte getIsWirelessExtend() {
		return isWirelessExtend;
	}

	public void setIsWirelessExtend(Byte isWirelessExtend) {
		this.isWirelessExtend = isWirelessExtend;
	}

	public void convert(Device device, boolean isVn) {
		this.id = device.getId();
		this.name = device.getName();
		if (this.name == null || this.name.trim().equals("")) {
			this.name = device.getMac();
		}
		if(isVn){
			this.sn = device.getModel() + device.getSn();
		}else{
			this.sn = device.getSn();
		}
		
		this.mac = device.getMac();
		this.hardwareVer = device.getHardwareVer();
		this.softVer = device.getSoftVer();
		this.bindTime = device.getBindTime();
		this.ip = device.getIp();
		this.radio = device.getRadio();
		this.model = device.getModel();
		this.modelId = device.getModelId();
		this.isFast = device.getIsFast();
		this.client24G = device.getClient24g();
		this.client5G = device.getClient5g();
		this.clients = this.client24G + this.client5G;
		this.status = device.getStatus();
	}

}
